home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / HFS Volume Format ƒ / HFSVolumesPriv.p < prev    next >
Encoding:
Text File  |  1997-10-01  |  21.2 KB  |  579 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        HFSVolumesPriv.p
  3.  
  4.      Contains:    On-disk data structures for HFS and HFS Plus volumes.
  5.  
  6.      Version:    Technology:    
  7.                  Release:    8.1a3c2
  8.  
  9.      Copyright:    © 1984-1997 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT HFSVolumesPriv;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __HFSVOLUMESPRIV__}
  28. {$SETC __HFSVOLUMESPRIV__ := 1}
  29.  
  30. {$I+}
  31. {$SETC HFSVolumesPrivIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILES__}
  38. {$I Files.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FINDER__}
  41. {$I Finder.p}
  42. {$ENDC}
  43.  
  44.  
  45.  
  46. {$PUSH}
  47. {$ALIGN MAC68K}
  48. {$LibExport+}
  49.  
  50. { Signatures used to differentiate between HFS and HFS Plus volumes }
  51.  
  52. CONST
  53.     kHFSSigWord                    = $4244;                        {  'BD' in ASCII  }
  54.     kHFSPlusSigWord                = $482B;                        {  'H+' in ASCII  }
  55.     kHFSPlusVersion                = $0003;                        {  will change as format changes  }
  56.     kHFSPlusMountVersion        = '8.01';                        {  will change as implementations change  }
  57.  
  58.  
  59. { CatalogNodeID is used to track catalog objects }
  60.  
  61. TYPE
  62.     CatalogNodeID                        = UInt32;
  63. { Unicode strings are used for file and folder names (HFS Plus only) }
  64.     UniStr255Ptr = ^UniStr255;
  65.     UniStr255 = RECORD
  66.         length:                    UInt16;                                    {  number of unicode characters  }
  67.         unicode:                ARRAY [0..254] OF UniChar;                {  unicode characters  }
  68.     END;
  69.  
  70.     ConstUniStr255Param                    = ^UniStr255;
  71.  
  72. CONST
  73.     kHFSMaxVolumeNameChars        = 27;
  74.     kHFSMaxFileNameChars        = 31;
  75.     kHFSPlusMaxFileNameChars    = 255;
  76.     CMMaxCName                    = 31;                            { •• this will go away  }
  77.  
  78.  
  79. { Extent overflow file data structures }
  80. { Small Extent key (HFS only) }
  81.  
  82. TYPE
  83.     SmallExtentKeyPtr = ^SmallExtentKey;
  84.     SmallExtentKey = RECORD
  85.         keyLength:                SInt8;                                    {  length of key, excluding this field  }
  86.         forkType:                SInt8;                                    {  0 = data fork, FF = resource fork  }
  87.         fileID:                    CatalogNodeID;                            {  file ID  }
  88.         startBlock:                UInt16;                                    {  first file allocation block number in this extent  }
  89.     END;
  90.  
  91. { Large Extent key (HFS Plus only) }
  92.     LargeExtentKeyPtr = ^LargeExtentKey;
  93.     LargeExtentKey = RECORD
  94.         keyLength:                UInt16;                                    {  length of key, excluding this field  }
  95.         forkType:                SInt8;                                    {  0 = data fork, FF = resource fork  }
  96.         pad:                    SInt8;                                    {  make the other fields align on 32-bit boundary  }
  97.         fileID:                    CatalogNodeID;                            {  file ID  }
  98.         startBlock:                UInt32;                                    {  first file allocation block number in this extent  }
  99.     END;
  100.  
  101. { Universal Extent Key }
  102.     ExtentKeyPtr = ^ExtentKey;
  103.     ExtentKey = RECORD
  104.         CASE INTEGER OF
  105.         0: (
  106.             small:                SmallExtentKey;
  107.             );
  108.         1: (
  109.             large:                LargeExtentKey;
  110.             );
  111.     END;
  112.  
  113.  
  114. CONST
  115.     kSmallExtentDensity            = 3;
  116.     kLargeExtentDensity            = 8;
  117.  
  118. { Small extent descriptor (HFS only) }
  119.  
  120. TYPE
  121.     SmallExtentDescriptorPtr = ^SmallExtentDescriptor;
  122.     SmallExtentDescriptor = RECORD
  123.         startBlock:                UInt16;                                    {  first allocation block  }
  124.         blockCount:                UInt16;                                    {  number of allocation blocks  }
  125.     END;
  126.  
  127. { Large extent descriptor (HFS Plus only) }
  128.     LargeExtentDescriptorPtr = ^LargeExtentDescriptor;
  129.     LargeExtentDescriptor = RECORD
  130.         startBlock:                UInt32;                                    {  first allocation block  }
  131.         blockCount:                UInt32;                                    {  number of allocation blocks  }
  132.     END;
  133.  
  134. { Universal extent descriptor }
  135.     ExtentDescriptorPtr = ^ExtentDescriptor;
  136.     ExtentDescriptor = RECORD
  137.         CASE INTEGER OF
  138.         0: (
  139.             small:                SmallExtentDescriptor;
  140.             );
  141.         1: (
  142.             large:                LargeExtentDescriptor;
  143.             );
  144.     END;
  145.  
  146. { Small extent record (HFS only) }
  147.     SmallExtentRecord                    = ARRAY [0..2] OF SmallExtentDescriptor;
  148. { Large extent record (HFS Plus only) }
  149.     LargeExtentRecord                    = ARRAY [0..7] OF LargeExtentDescriptor;
  150. { Universal extent record }
  151.     ExtentRecordPtr = ^ExtentRecord;
  152.     ExtentRecord = RECORD
  153.         CASE INTEGER OF
  154.         0: (
  155.             small:                SmallExtentRecord;
  156.             );
  157.         1: (
  158.             large:                LargeExtentRecord;
  159.             );
  160.     END;
  161.  
  162.  
  163. { Fork data info (HFS Plus only) - 80 bytes }
  164.     ForkDataPtr = ^ForkData;
  165.     ForkData = RECORD
  166.         logicalSize:            UInt64;                                    {  fork's logical size in bytes  }
  167.         clumpSize:                UInt32;                                    {  fork's clump size in bytes  }
  168.         totalBlocks:            UInt32;                                    {  total blocks used by this fork  }
  169.         extents:                LargeExtentRecord;                        {  initial set of extents  }
  170.     END;
  171.  
  172. { Permissions info (HFS Plus only) - 16 bytes }
  173.     PermissionsPtr = ^Permissions;
  174.     Permissions = RECORD
  175.         ownerID:                UInt32;                                    {  user or group ID of file/folder owner  }
  176.         groupID:                UInt32;                                    {  additional user of group ID  }
  177.         permissions:            UInt32;                                    {  permissions (bytes: unused, owner, group, everyone)  }
  178.         specialDevice:            UInt32;                                    {  UNIX: device for character or block special file  }
  179.     END;
  180.  
  181. { Catalog file data structures }
  182.  
  183. CONST
  184.     kHFSRootParentID            = 1;                            {  Parent ID of the root folder  }
  185.     kHFSRootFolderID            = 2;                            {  Folder ID of the root folder  }
  186.     kHFSExtentsFileID            = 3;                            {  File ID of the extents file  }
  187.     kHFSCatalogFileID            = 4;                            {  File ID of the catalog file  }
  188.     kHFSBadBlockFileID            = 5;                            {  File ID of the bad allocation block file  }
  189.     kHFSAllocationFileID        = 6;                            {  File ID of the allocation file (HFS Plus only)  }
  190.     kHFSStartupFileID            = 7;                            {  File ID of the startup file (HFS Plus only)  }
  191.     kHFSAttributesFileID        = 8;                            {  File ID of the attribute file (HFS Plus only)  }
  192.     kBogusExtentFileID            = 15;                            {  Used for exchanging extents in extents file  }
  193.     kFirstFreeCatalogNodeID        = 16;
  194.  
  195.  
  196. { Small catalog key (HFS only) }
  197.  
  198. TYPE
  199.     SmallCatalogKeyPtr = ^SmallCatalogKey;
  200.     SmallCatalogKey = RECORD
  201.         keyLength:                SInt8;                                    {  key length (in bytes)  }
  202.         reserved:                SInt8;                                    {  reserved (set to zero)  }
  203.         parentID:                CatalogNodeID;                            {  parent folder ID  }
  204.         nodeName:                Str31;                                    {  catalog node name  }
  205.     END;
  206.  
  207. { Large catalog key (HFS Plus only) }
  208.     LargeCatalogKeyPtr = ^LargeCatalogKey;
  209.     LargeCatalogKey = RECORD
  210.         keyLength:                UInt16;                                    {  key length (in bytes)  }
  211.         parentID:                CatalogNodeID;                            {  parent folder ID  }
  212.         nodeName:                UniStr255;                                {  catalog node name  }
  213.     END;
  214.  
  215. { Universal catalog key }
  216.     CatalogKeyPtr = ^CatalogKey;
  217.     CatalogKey = RECORD
  218.         CASE INTEGER OF
  219.         0: (
  220.             small:                SmallCatalogKey;
  221.             );
  222.         1: (
  223.             large:                LargeCatalogKey;
  224.             );
  225.     END;
  226.  
  227.  
  228. { Catalog record types }
  229.  
  230. CONST
  231.                                                                 {  HFS Catalog Records  }
  232.     kSmallFolderRecord            = $0100;                        {  Folder record  }
  233.     kSmallFileRecord            = $0200;                        {  File record  }
  234.     kSmallFolderThreadRecord    = $0300;                        {  Folder thread record  }
  235.     kSmallFileThreadRecord        = $0400;                        {  File thread record  }
  236.                                                                 {  HFS Plus Catalog Records  }
  237.     kLargeFolderRecord            = 1;                            {  Folder record  }
  238.     kLargeFileRecord            = 2;                            {  File record  }
  239.     kLargeFolderThreadRecord    = 3;                            {  Folder thread record  }
  240.     kLargeFileThreadRecord        = 4;                            {  File thread record  }
  241.  
  242.  
  243. { Catalog file record flags }
  244.     kFileLockedBit                = $0000;                        {  file is locked and cannot be written to  }
  245.     kFileLockedMask                = $0001;
  246.     kFileThreadExistsBit        = $0001;                        {  a file thread record exists for this file  }
  247.     kFileThreadExistsMask        = $0002;
  248.  
  249.  
  250. { Small catalog folder record (HFS only) - 70 bytes }
  251.  
  252. TYPE
  253.     SmallCatalogFolderPtr = ^SmallCatalogFolder;
  254.     SmallCatalogFolder = RECORD
  255.         recordType:                SInt16;                                    {  record type  }
  256.         flags:                    UInt16;                                    {  folder flags  }
  257.         valence:                UInt16;                                    {  folder valence  }
  258.         folderID:                CatalogNodeID;                            {  folder ID  }
  259.         createDate:                UInt32;                                    {  date and time of creation  }
  260.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  261.         backupDate:                UInt32;                                    {  date and time of last backup  }
  262.         userInfo:                DInfo;                                    {  Finder information  }
  263.         finderInfo:                DXInfo;                                    {  additional Finder information  }
  264.         reserved:                ARRAY [0..3] OF UInt32;                    {  reserved - set to zero  }
  265.     END;
  266.  
  267. { Large catalog folder record (HFS Plus only) - 88 bytes }
  268.     LargeCatalogFolderPtr = ^LargeCatalogFolder;
  269.     LargeCatalogFolder = RECORD
  270.         recordType:                SInt16;                                    {  record type = HFS Plus folder record  }
  271.         flags:                    UInt16;                                    {  file flags  }
  272.         valence:                UInt32;                                    {  folder's valence (limited to 2^16 in Mac OS)  }
  273.         folderID:                CatalogNodeID;                            {  folder ID  }
  274.         createDate:                UInt32;                                    {  date and time of creation  }
  275.         contentModDate:            UInt32;                                    {  date and time of last content modification  }
  276.         modifyDate:                UInt32;                                    {  date and time of last modification (any kind)  }
  277.         accessDate:                UInt32;                                    {  date and time of last access (Rhapsody only)  }
  278.         backupDate:                UInt32;                                    {  date and time of last backup  }
  279.         permissions:            Permissions;                            {  permissions (for Rhapsody)  }
  280.         userInfo:                DInfo;                                    {  Finder information  }
  281.         finderInfo:                DXInfo;                                    {  additional Finder information  }
  282.         textEncoding:            UInt32;                                    {  hint for name conversions  }
  283.         reserved:                UInt32;                                    {  reserved - set to zero  }
  284.     END;
  285.  
  286. { Small catalog file record (HFS only) - 102 bytes }
  287.     SmallCatalogFilePtr = ^SmallCatalogFile;
  288.     SmallCatalogFile = RECORD
  289.         recordType:                SInt16;                                    {  record type  }
  290.         flags:                    SInt8;                                    {  file flags  }
  291.         fileType:                SInt8;                                    {  file type (unused ?)  }
  292.         userInfo:                FInfo;                                    {  Finder information  }
  293.         fileID:                    CatalogNodeID;                            {  file ID  }
  294.         dataStartBlock:            UInt16;                                    {  not used - set to zero  }
  295.         dataLogicalSize:        SInt32;                                    {  logical EOF of data fork  }
  296.         dataPhysicalSize:        SInt32;                                    {  physical EOF of data fork  }
  297.         rsrcStartBlock:            UInt16;                                    {  not used - set to zero  }
  298.         rsrcLogicalSize:        SInt32;                                    {  logical EOF of resource fork  }
  299.         rsrcPhysicalSize:        SInt32;                                    {  physical EOF of resource fork  }
  300.         createDate:                UInt32;                                    {  date and time of creation  }
  301.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  302.         backupDate:                UInt32;                                    {  date and time of last backup  }
  303.         finderInfo:                FXInfo;                                    {  additional Finder information  }
  304.         clumpSize:                UInt16;                                    {  file clump size (not used)  }
  305.         dataExtents:            SmallExtentRecord;                        {  first data fork extent record  }
  306.         rsrcExtents:            SmallExtentRecord;                        {  first resource fork extent record  }
  307.         reserved:                UInt32;                                    {  reserved - set to zero  }
  308.     END;
  309.  
  310. { Large catalog file record (HFS Plus only) - 248 bytes }
  311.     LargeCatalogFilePtr = ^LargeCatalogFile;
  312.     LargeCatalogFile = RECORD
  313.         recordType:                SInt16;                                    {  record type = HFS Plus file record  }
  314.         flags:                    UInt16;                                    {  file flags  }
  315.         reserved1:                UInt32;                                    {  number of links (normally just one)  }
  316.         fileID:                    CatalogNodeID;                            {  file ID  }
  317.         createDate:                UInt32;                                    {  date and time of creation  }
  318.         contentModDate:            UInt32;                                    {  date and time of last content modification  }
  319.         modifyDate:                UInt32;                                    {  date and time of last modification (any kind)  }
  320.         accessDate:                UInt32;                                    {  date and time of last access (Rhapsody only)  }
  321.         backupDate:                UInt32;                                    {  date and time of last backup  }
  322.         permissions:            Permissions;                            {  permissions (for Rhapsody)  }
  323.         userInfo:                FInfo;                                    {  Finder information  }
  324.         finderInfo:                FXInfo;                                    {  additional Finder information  }
  325.         textEncoding:            UInt32;                                    {  hint for name conversions  }
  326.         reserved2:                UInt32;                                    {  reserved - set to zero  }
  327.                                                                         {  start on double long (64 bit) boundry  }
  328.         dataFork:                ForkData;                                {  size and block data for data fork  }
  329.         resourceFork:            ForkData;                                {  size and block data for resource fork  }
  330.     END;
  331.  
  332. { Small catalog thread record (HFS only) - 46 bytes }
  333.     SmallCatalogThreadPtr = ^SmallCatalogThread;
  334.     SmallCatalogThread = RECORD
  335.         recordType:                SInt16;                                    {  record type  }
  336.         reserved:                ARRAY [0..1] OF SInt32;                    {  reserved - set to zero  }
  337.         parentID:                CatalogNodeID;                            {  parent ID for this catalog node  }
  338.         nodeName:                Str31;                                    {  name of this catalog node  }
  339.     END;
  340.  
  341. { Large catalog thread record (HFS Plus only) -- 264 bytes }
  342.     LargeCatalogThreadPtr = ^LargeCatalogThread;
  343.     LargeCatalogThread = RECORD
  344.         recordType:                SInt16;                                    {  record type  }
  345.         reserved:                SInt16;                                    {  reserved - set to zero  }
  346.         parentID:                CatalogNodeID;                            {  parent ID for this catalog node  }
  347.         nodeName:                UniStr255;                                {  name of this catalog node (variable length)  }
  348.     END;
  349.  
  350. { Universal catalog data record }
  351.     CatalogRecordPtr = ^CatalogRecord;
  352.     CatalogRecord = RECORD
  353.         CASE INTEGER OF
  354.         0: (
  355.             recordType:            SInt16;
  356.             );
  357.         1: (
  358.             smallFolder:        SmallCatalogFolder;
  359.             );
  360.         2: (
  361.             smallFile:            SmallCatalogFile;
  362.             );
  363.         3: (
  364.             smallThread:        SmallCatalogThread;
  365.             );
  366.         4: (
  367.             largeFolder:        LargeCatalogFolder;
  368.             );
  369.         5: (
  370.             largeFile:            LargeCatalogFile;
  371.             );
  372.         6: (
  373.             largeThread:        LargeCatalogThread;
  374.             );
  375.     END;
  376.  
  377. {
  378.       Key for records in the attributes file.  Fields are compared in the order:
  379.           cnid, attributeName, startBlock
  380. }
  381.     AttributeKeyPtr = ^AttributeKey;
  382.     AttributeKey = RECORD
  383.         keyLength:                UInt16;                                    {  must set kBTBigKeysMask and kBTVariableIndexKeysMask in BTree header's attributes  }
  384.         pad:                    UInt16;
  385.         cnid:                    CatalogNodeID;                            {  file or folder ID  }
  386.         startBlock:                UInt32;                                    {  block # relative to start of attribute  }
  387.         attributeName:            UniStr255;                                {  variable length  }
  388.     END;
  389.  
  390. {
  391.       These are the types of records in the attribute B-tree.  The values were chosen
  392.       so that they wouldn't conflict with the catalog record types.
  393. }
  394.  
  395. CONST
  396.     kAttributeInlineData        = $10;                            {  if size <  kAttrOverflowSize  }
  397.     kAttributeForkData            = $20;                            {  if size >= kAttrOverflowSize  }
  398.     kAttributeExtents            = $30;                            {  overflow extents for large attributes  }
  399.  
  400.  
  401. {
  402.       AttributeInlineData
  403.       For small attributes, whose entire value is stored within this one
  404.       B-tree record.  The key for this record is of the form:
  405.           ( CNID, name, 0 ).        (startBlock == 0)
  406.       There would not be any other records for this attribute.
  407. }
  408.  
  409. TYPE
  410.     AttributeInlineDataPtr = ^AttributeInlineData;
  411.     AttributeInlineData = RECORD
  412.         recordType:                UInt32;                                    {     = kAttributeInlineData }
  413.         logicalSize:            UInt32;                                    {     size in bytes of userData }
  414.         userData:                PACKED ARRAY [0..1] OF Byte;            {     variable length; space allocated is a multiple of 2 bytes }
  415.     END;
  416.  
  417. {
  418.       AttributeForkData
  419.       For larger attributes, whose value is stored in allocation blocks.
  420.       The key for this record is of the form:
  421.           ( CNID, name, 0 ).        (startBlock == 0)
  422.       If the attribute has more than 8 extents, there will be additonal
  423.       records (of type AttributeExtents) for this attribute.
  424. }
  425.     AttributeForkDataPtr = ^AttributeForkData;
  426.     AttributeForkData = RECORD
  427.         recordType:                UInt32;                                    {     = kAttributeForkData }
  428.         reserved:                UInt32;
  429.         theFork:                ForkData;                                {     size and first extents of value }
  430.     END;
  431.  
  432. {
  433.       AttributeExtents
  434.       This record contains information about overflow extents for large,
  435.       fragmented attributes.  The key for this record is of the form:
  436.           ( CNID, name, !=0 ).    (startBlock != 0)
  437.       The startBlock field of the key is the first allocation block number
  438.       (relative to the start of the attribute value) represented by the
  439.       extents in this record.
  440. }
  441.     AttributeExtentsPtr = ^AttributeExtents;
  442.     AttributeExtents = RECORD
  443.         recordType:                UInt32;                                    {     = kAttributeExtents }
  444.         reserved:                UInt32;
  445.         extents:                LargeExtentRecord;                        {     additional extents }
  446.     END;
  447.  
  448. {     A generic Attribute Record }
  449.     AttributeRecordPtr = ^AttributeRecord;
  450.     AttributeRecord = RECORD
  451.         CASE INTEGER OF
  452.         0: (
  453.             recordType:            UInt32;
  454.             );
  455.         1: (
  456.             inlineData:            AttributeInlineData;
  457.             );
  458.         2: (
  459.             forkData:            AttributeForkData;
  460.             );
  461.         3: (
  462.             overflowExtents:    AttributeExtents;
  463.             );
  464.     END;
  465.  
  466. { Key and node lengths }
  467.  
  468. CONST
  469.     kLargeExtentKeyMaximumLength = 10;
  470.     kSmallExtentKeyMaximumLength = 7;
  471.     kLargeCatalogKeyMaximumLength = 516;
  472.     kLargeCatalogKeyMinimumLength = 6;
  473.     kSmallCatalogKeyMaximumLength = 37;
  474.     kSmallCatalogKeyMinimumLength = 6;
  475.     kAttributeKeyMaximumLength    = 522;
  476.     kAttributeKeyMinimumLength    = 12;
  477.     kLargeCatalogMinimumNodeSize = 4096;
  478.     kLargeExtentMinimumNodeSize    = 512;
  479.     kAttributeMinimumNodeSize    = 4096;
  480.  
  481.  
  482.                                                                 {  Bits 0-6 are reserved (always cleared by MountVol call)  }
  483.     kVolumeHardwareLockBit        = 7;                            {  volume is locked by hardware  }
  484.     kVolumeUnmountedBit            = 8;                            {  volume was successfully unmounted  }
  485.     kVolumeSparedBlocksBit        = 9;                            {  volume has bad blocks spared  }
  486.     kVolumeNoCacheRequiredBit    = 10;                            {  don't cache volume blocks (i.e. RAM or ROM disk)  }
  487.     kBootVolumeInconsistentBit    = 11;                            {  boot volume is inconsistent (System 7.6)  }
  488.                                                                 {  Bits 12-14 are reserved for future use  }
  489.     kVolumeSoftwareLockBit        = 15;                            {  volume is locked by software  }
  490.     kVolumeHardwareLockMask        = $80;
  491.     kVolumeUnmountedMask        = $0100;
  492.     kVolumeSparedBlocksMask        = $0200;
  493.     kVolumeNoCacheRequiredMask    = $0400;
  494.     kBootVolumeInconsistentMask    = $0800;
  495.     kVolumeSoftwareLockMask        = $8000;
  496.     kMDBAttributesMask            = $8380;
  497.  
  498.  
  499. { Master Directory Block (HFS only) - 162 bytes }
  500. { Stored at sector #2 (3rd sector) }
  501.  
  502. TYPE
  503.     MasterDirectoryBlockPtr = ^MasterDirectoryBlock;
  504.     MasterDirectoryBlock = RECORD
  505.         drSigWord:                UInt16;                                    {  volume signature  }
  506.         drCrDate:                UInt32;                                    {  date and time of volume creation  }
  507.         drLsMod:                UInt32;                                    {  date and time of last modification  }
  508.         drAtrb:                    UInt16;                                    {  volume attributes  }
  509.         drNmFls:                SInt16;                                    {  number of files in root folder  }
  510.         drVBMSt:                UInt16;                                    {  first block of volume bitmap  }
  511.         drAllocPtr:                UInt16;                                    {  start of next allocation search  }
  512.         drNmAlBlks:                UInt16;                                    {  number of allocation blocks in volume  }
  513.         drAlBlkSiz:                SInt32;                                    {  size (in bytes) of allocation blocks  }
  514.         drClpSiz:                SInt32;                                    {  default clump size  }
  515.         drAlBlSt:                SInt16;                                    {  first allocation block in volume  }
  516.         drNxtCNID:                UInt32;                                    {  next unused catalog node ID  }
  517.         drFreeBks:                SInt16;                                    {  number of unused allocation blocks  }
  518.         drVN:                    Str27;                                    {  volume name  }
  519.                                                                         {  Master Directory Block extensions for HFS  }
  520.         drVolBkUp:                UInt32;                                    {  date and time of last backup  }
  521.         drVSeqNum:                UInt16;                                    {  volume backup sequence number  }
  522.         drWrCnt:                SInt32;                                    {  volume write count  }
  523.         drXTClpSiz:                SInt32;                                    {  clump size for extents overflow file  }
  524.         drCTClpSiz:                SInt32;                                    {  clump size for catalog file  }
  525.         drNmRtDirs:                SInt16;                                    {  number of directories in root folder  }
  526.         drFilCnt:                SInt32;                                    {  number of files in volume  }
  527.         drDirCnt:                SInt32;                                    {  number of directories in volume  }
  528.         drFndrInfo:                ARRAY [0..7] OF SInt32;                    {  information used by the Finder  }
  529.         drEmbedSigWord:            UInt16;                                    {  embedded volume signature (formerly drVCSize)  }
  530.         drEmbedExtent:            SmallExtentDescriptor;                    {  embedded volume location and size (formerly drVBMCSize and drCtlCSize)  }
  531.         drXTFlSize:                SInt32;                                    {  size of extents overflow file  }
  532.         drXTExtRec:                SmallExtentRecord;                        {  extent record for extents overflow file  }
  533.         drCTFlSize:                SInt32;                                    {  size of catalog file  }
  534.         drCTExtRec:                SmallExtentRecord;                        {  extent record for catalog file  }
  535.     END;
  536.  
  537. { VolumeHeader (HFS Plus only) - 512 bytes }
  538. { Stored at sector #0 (1st sector) and last sector }
  539.     VolumeHeaderPtr = ^VolumeHeader;
  540.     VolumeHeader = RECORD
  541.         signature:                UInt16;                                    {  volume signature == 'H+'  }
  542.         version:                UInt16;                                    {  current version is kHFSPlusVersion  }
  543.         attributes:                UInt32;                                    {  volume attributes  }
  544.         lastMountedVersion:        UInt32;                                    {  implementation version which last mounted volume  }
  545.         reserved:                UInt32;                                    {  reserved - set to zero  }
  546.         createDate:                UInt32;                                    {  date and time of volume creation  }
  547.         modifyDate:                UInt32;                                    {  date and time of last modification  }
  548.         backupDate:                UInt32;                                    {  date and time of last backup  }
  549.         checkedDate:            UInt32;                                    {  date and time of last disk check  }
  550.         fileCount:                UInt32;                                    {  number of files in volume  }
  551.         folderCount:            UInt32;                                    {  number of directories in volume  }
  552.         blockSize:                UInt32;                                    {  size (in bytes) of allocation blocks  }
  553.         totalBlocks:            UInt32;                                    {  number of allocation blocks in volume (includes this header and VBM }
  554.         freeBlocks:                UInt32;                                    {  number of unused allocation blocks  }
  555.         nextAllocation:            UInt32;                                    {  start of next allocation search  }
  556.         rsrcClumpSize:            UInt32;                                    {  default resource fork clump size  }
  557.         dataClumpSize:            UInt32;                                    {  default data fork clump size  }
  558.         nextCatalogID:            CatalogNodeID;                            {  next unused catalog node ID  }
  559.         writeCount:                UInt32;                                    {  volume write count  }
  560.         encodingsBitmap:        UInt64;                                    {  which encodings have been use  on this volume  }
  561.         finderInfo:                PACKED ARRAY [0..31] OF UInt8;            {  information used by the Finder  }
  562.         allocationFile:            ForkData;                                {  allocation bitmap file  }
  563.         extentsFile:            ForkData;                                {  extents B-tree file  }
  564.         catalogFile:            ForkData;                                {  catalog B-tree file  }
  565.         attributesFile:            ForkData;                                {  extended attributes B-tree file  }
  566.         startupFile:            ForkData;                                {  boot file  }
  567.     END;
  568.  
  569. {$ALIGN RESET}
  570. {$POP}
  571.  
  572. {$SETC UsingIncludes := HFSVolumesPrivIncludes}
  573.  
  574. {$ENDC} {__HFSVOLUMESPRIV__}
  575.  
  576. {$IFC NOT UsingIncludes}
  577.  END.
  578. {$ENDC}
  579.